3.4.40 \(\int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx\) [340]

Optimal. Leaf size=60 \[ -\frac {\csc (c+d x)}{a d}-\frac {b \log (\sin (c+d x))}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) \log (a+b \sin (c+d x))}{b d} \]

[Out]

-csc(d*x+c)/a/d-b*ln(sin(d*x+c))/a^2/d-(1-b^2/a^2)*ln(a+b*sin(d*x+c))/b/d

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2916, 12, 908} \begin {gather*} -\frac {\left (1-\frac {b^2}{a^2}\right ) \log (a+b \sin (c+d x))}{b d}-\frac {b \log (\sin (c+d x))}{a^2 d}-\frac {\csc (c+d x)}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Cos[c + d*x]*Cot[c + d*x]^2)/(a + b*Sin[c + d*x]),x]

[Out]

-(Csc[c + d*x]/(a*d)) - (b*Log[Sin[c + d*x]])/(a^2*d) - ((1 - b^2/a^2)*Log[a + b*Sin[c + d*x]])/(b*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\cos (c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {b^2 \left (b^2-x^2\right )}{x^2 (a+x)} \, dx,x,b \sin (c+d x)\right )}{b^3 d}\\ &=\frac {\text {Subst}\left (\int \frac {b^2-x^2}{x^2 (a+x)} \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {b^2}{a x^2}-\frac {b^2}{a^2 x}+\frac {-a^2+b^2}{a^2 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=-\frac {\csc (c+d x)}{a d}-\frac {b \log (\sin (c+d x))}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) \log (a+b \sin (c+d x))}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 54, normalized size = 0.90 \begin {gather*} \frac {-a b \csc (c+d x)-b^2 \log (\sin (c+d x))+\left (-a^2+b^2\right ) \log (a+b \sin (c+d x))}{a^2 b d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Cos[c + d*x]*Cot[c + d*x]^2)/(a + b*Sin[c + d*x]),x]

[Out]

(-(a*b*Csc[c + d*x]) - b^2*Log[Sin[c + d*x]] + (-a^2 + b^2)*Log[a + b*Sin[c + d*x]])/(a^2*b*d)

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 59, normalized size = 0.98

method result size
derivativedivides \(\frac {-\frac {1}{a \sin \left (d x +c \right )}-\frac {b \ln \left (\sin \left (d x +c \right )\right )}{a^{2}}+\frac {\left (-a^{2}+b^{2}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{2} b}}{d}\) \(59\)
default \(\frac {-\frac {1}{a \sin \left (d x +c \right )}-\frac {b \ln \left (\sin \left (d x +c \right )\right )}{a^{2}}+\frac {\left (-a^{2}+b^{2}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{2} b}}{d}\) \(59\)
risch \(\frac {i x}{b}+\frac {2 i c}{b d}-\frac {2 i {\mathrm e}^{i \left (d x +c \right )}}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right )}{b d}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right )}{a^{2} d}\) \(143\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*cot(d*x+c)^2/(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/a/sin(d*x+c)-1/a^2*b*ln(sin(d*x+c))+(-a^2+b^2)/a^2/b*ln(a+b*sin(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.42, size = 57, normalized size = 0.95 \begin {gather*} -\frac {\frac {b \log \left (\sin \left (d x + c\right )\right )}{a^{2}} + \frac {{\left (a^{2} - b^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{2} b} + \frac {1}{a \sin \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*cot(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

-(b*log(sin(d*x + c))/a^2 + (a^2 - b^2)*log(b*sin(d*x + c) + a)/(a^2*b) + 1/(a*sin(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 69, normalized size = 1.15 \begin {gather*} -\frac {b^{2} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) \sin \left (d x + c\right ) + a b}{a^{2} b d \sin \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*cot(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

-(b^2*log(1/2*sin(d*x + c))*sin(d*x + c) + (a^2 - b^2)*log(b*sin(d*x + c) + a)*sin(d*x + c) + a*b)/(a^2*b*d*si
n(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos {\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*cot(d*x+c)**2/(a+b*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)*cot(c + d*x)**2/(a + b*sin(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 7.44, size = 72, normalized size = 1.20 \begin {gather*} -\frac {\frac {b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{2}} + \frac {{\left (a^{2} - b^{2}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{2} b} - \frac {b \sin \left (d x + c\right ) - a}{a^{2} \sin \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*cot(d*x+c)^2/(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

-(b*log(abs(sin(d*x + c)))/a^2 + (a^2 - b^2)*log(abs(b*sin(d*x + c) + a))/(a^2*b) - (b*sin(d*x + c) - a)/(a^2*
sin(d*x + c)))/d

________________________________________________________________________________________

Mupad [B]
time = 4.81, size = 118, normalized size = 1.97 \begin {gather*} \frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (\frac {b}{a^2}-\frac {1}{b}\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d}-\frac {\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d}+\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{b\,d}-\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(c + d*x)*cot(c + d*x)^2)/(a + b*sin(c + d*x)),x)

[Out]

(log(a + 2*b*tan(c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^2)*(b/a^2 - 1/b))/d - tan(c/2 + (d*x)/2)/(2*a*d) - cot(
c/2 + (d*x)/2)/(2*a*d) + log(tan(c/2 + (d*x)/2)^2 + 1)/(b*d) - (b*log(tan(c/2 + (d*x)/2)))/(a^2*d)

________________________________________________________________________________________